<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['ischecklogin']=model('jy_weishop/member')->checklogin('','','','',true);
	if($_SESSION['uid'] && $this->plugin_exists('jy_yuejie')){
		$return['showintype']=model('jy_yuejie/member')->checkinlog();
	}
	$basic=$this->plugin_setting('basic');
	$return['member']=cfc('core')->get_member($_SESSION['uid']);
	$pindex = max(1, intval($post['page']));
	$psize = 10;
	$total='';
	$sharelink='jy_shoufrom/fuwu.list//fromuser='.$_SESSION['uid'];
	$return['sharedata']=array(
			'title'=>$return['pluginset']['share_title']?$return['pluginset']['share_title']:'项目列表',
			'desc'=>$return['pluginset']['share_desc']?$return['pluginset']['share_desc']:'项目列表，一个属于自己的在线报修系统！',
			'link'=>custom_url($sharelink,true),
			'imgUrl'=>tomedia($return['pluginset']['share_image'])
	);
	$return['list']=array();
	$return['groups']=pdo_getall('jy_shoufrom_group',array('uniacid'=>$_SESSION['uniacid']),array('id','title'),'id','paixu desc,id desc');
	$return['params']=array('groupid'=>intval($_RQ['groupid']));
	set_html('title',$basic['title']?$basic['title']:'项目列表');
	exi($return);
}
if($_RQ['op']=='getlist'){
	$params=array('status'=>1,'uniacid'=>$_SESSION['uniacid']);
	$groupid=intval($_RQ['groupid']);
	if($groupid){
		$params['groupid']=$groupid;
	}
	$psize=20;
	$pindex=intval($_RQ['page'])?:1;
	$parameter=array(
		'params'=>$params,
		'limit'=>array($pindex,$psize),
		'orderby'=>'id desc',
	);
	$list=$this->get_list('list',$parameter);
	if(!$list){
		exi('none');
	}
	foreach($list as &$lv){
		$lv['image']=tomedia($lv['image']);
		if(strpos($lv['order_types'],';0;') !== false){ 
			$lv['order_types0']=1;
		}
		if(strpos($lv['order_types'],';1;') !== false){ 
			$lv['order_types1']=1;
		}
	}
	$return['list']=$list;
	exi($return);
}
?>